#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include <iostream>
#include <vector>
#include "time.h"
#include <cbw.h>              /* Universal Library's include file */
#define RED cvScalar(0,0,255)
#define BLUE cvScalar(255,0,0)
#define GREEN cvScalar(0,255,0)
#define MAGENTA cvScalar(255,0,255)
#define BLACK cvScalar(0,0,0)

#define BOARD_NUM   0            /* Number of A/D board as defined with InstaCal */
#define CHANNEL     0            /* Number of A/D channel to read */
#define ADRANGE     BIP10VOLTS /* A/D voltage range */
#define DARANGE     UNI4VOLTS   /* D/A voltage range */

/* Function prototypes */
void escribe(float *Vout);
void lee(float *Vin);

using namespace System;
using namespace System::Runtime::InteropServices;

class cvPlotGraph{
public:
	cvPlotGraph(System::String^ name,CvSize size, int volts_div, int segs_div);
	void Clear();
	void Update();
	void DrawLine(double t1, double v1, double t2, double v2, CvScalar color);
	double time;
	int volts_per_div;
	int segs_per_div;
	IplImage* Img;
private:
	char *char_name;
	CvSize plot_size;

	CvPoint x_zero;
	CvPoint x_end;
	CvPoint y_pos;
	CvPoint y_neg;
	CvFont font;
	clock_t start;

};